<me:UIGAAUF
    x:Class="WPFExcelReport.TGDEXG"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
     xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
     xmlns:me="clr-namespace:WPFExcelReport" 
     xmlns:PR="clr-namespace:WPFExcelReport;assembly=TICC_PRULES"  
     xmlns:YB="clr-namespace:WPFExcelReport;assembly=TGASTGA" 
    x:Name="TV"
    FontSize="12"
    Loaded="Window_Loaded"
 >
    <me:UIGAAUF.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:UPPERGB2312 x:Key="UGB"/>
    </me:UIGAAUF.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" /> 
        </Grid.RowDefinitions>
        <WrapPanel>
            <Grid Margin="10,0,0,0" VerticalAlignment="Top" IsEnabled="{Binding ERLKZ,ElementName=TV}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Button Click="TakeOverZUCommand" Height="20" Margin="5,0,0,0" Width="20" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/arrow-reload.png" />
                    </Button.Background>
                </Button>
                <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=转换}}"  ></TextBlock>
            </Grid>
            <TextBlock Text="复板结果尚未批复" Foreground="Red" Visibility="{Binding ERLKZ,ElementName=TV,Converter={StaticResource nbv}}"></TextBlock>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=批次}}"  VerticalAlignment="Center" />
                <TextBlock Grid.Column="1" Background="White"  Text="{Binding Path=GAAUFKRS, Source={StaticResource ResourceKey=vwMaster}}"  Width="40"    
                         Margin="0,0,0,0"   VerticalAlignment="Center"/>
                <TextBlock Grid.Column="2" Background="White"  Text="{Binding Path=GAAUFLFD, Source={StaticResource ResourceKey=vwMaster}}"    Width="80"    
                         Margin="0,0,0,0"   VerticalAlignment="Center"/>
                <TextBlock Grid.Column="3" Background="White"  Text="{Binding Path=GAAUFPOS, Source={StaticResource ResourceKey=vwMaster}}"    Width="60"    
                         Margin="0,0,0,0"   VerticalAlignment="Center"/>
            </Grid>
        </WrapPanel>
        <Expander Header="{Binding Source={Localization:Translate Word=配比}}" Name="PB" Grid.Row="1" 
                  Visibility="{Binding IsAuto,ElementName=TV,Converter={StaticResource bv}}">  
        <DataGrid Grid.Row="1"  
                AutoGenerateColumns="False"  EnableRowVirtualization="False"  
                  Name="dlgMaster"  IsReadOnly="True"  
                  ItemsSource="{Binding Source={StaticResource vwMaster }}" 
                  HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True"  
                   RowDetailsVisibilityMode="VisibleWhenSelected"  
                  EnableColumnVirtualization="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <DataGrid.Columns>
                <DataGridTextColumn Header="" Binding="{Binding GAAUFKRS}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=生产单}}" Binding="{Binding GAAUFLFD}" Width="Auto"/>
                <DataGridTextColumn Header="" Binding="{Binding GAAUFPOS}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=ID}}" Binding="{Binding GAPOS}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=类型}}" Binding="{Binding GAAUFMSL,Converter={StaticResource ResourceKey=UGB}}" Width="Auto"   />
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=纱线}}" Binding="{Binding GAART, Converter={StaticResource ResourceKey=UGB}}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=版本}}" Binding="{Binding GAVAR,Converter={StaticResource ResourceKey=UGB}}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=色号}}" Binding="{Binding GAFARBE, Converter={StaticResource ResourceKey=UGB}}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=批次}}" Binding="{Binding Path=GABEM, Converter={StaticResource ResourceKey=UGB}}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=比例}}" Binding="{Binding Path=GASP1, Converter={StaticResource ResourceKey=d1000}}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=需求}}" Binding="{Binding Path=GAKG1, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=预留}}" Binding="{Binding Path=GAKG2, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=总仓}}" Binding="{Binding Path=GAKG3, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=车间}}" Binding="{Binding Path=GAKG5, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>

                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=版本}}" Binding="{Binding GAURVAR}" Width="Auto"/>
            </DataGrid.Columns>

        </DataGrid>
        </Expander>
    </Grid>
</me:UIGAAUF>
